package com.tfjybj.itoo.exam.provider.service;

import com.dmsdbj.itoo.tool.base.service.BaseServicePlus;
import com.github.pagehelper.PageInfo;
import com.tfjybj.itoo.exam.entity.JudgeTaskEntity;
import com.tfjybj.itoo.exam.model.*;

import java.io.File;
import java.io.IOException;
import java.util.List;


/**
 * JudgeTaskService接口
 * judgeTask表
 *
 * @author 任晓帅
 * @version 2.0.0
 * @since 2.0.0 2018-11-15 19:40:28
 */
public interface JudgeTaskService extends BaseServicePlus<JudgeTaskEntity> {

    //region 模板生成：模糊查询

    /**
     * 根据批卷班级名称模糊查询judgeTask
     *
     * @param teachclassName 批卷班级名称
     * @param pageNo         页码
     * @param pageSize       页数
     * @return 模糊查询的judgeTask
     * @author 任晓帅
     * @since 2.0.0 2018-11-15 19:40:28
     */
    PageInfo<JudgeTaskEntity> queryByLikeTeachclassName(String teachclassName, Integer pageNo, Integer pageSize);
    //endregion

    /* **********************************以下为非模板生成的内容********************************* */
    List<JudgeTaskModelResult> queryAllByModel(JudgeTaskModelNorequired judgeTaskModelNorequired);

    List<JudgeTaskModelResult> queryDistinctExam();

    List<JudgeTaskModelResult> queryDistinctBigQues();

    List<JudgeTaskModelResult> queryDistinctClass();










    List<PaperRecordModel> queryJudgeQues(String examId, String questionTypeId, String examClassId);

    Integer queryJudgeSituation(String examId, String questionTypeId, String examClassId);

    boolean updateManualJudge(String id, double score);

    boolean queryEachStuScore(String examId, String questionTypeId, String examClassId);

    /**
     * 查询考试名称
     * @return
     * @author 刘梦娇
     * @since 2018-12-12 17:24:19
     */
    List<ExaminationModel> queryExamName();

    /**
     * 查询题型名称
     * @param examinationId
     * @return
     * @author 刘梦娇
     * @since 2018-12-12 17:20:57
     */
    List<JudgeTaskModelResult> queryQuestionTypeName(String examinationId);

    boolean automaticJudge(PaperOnlineRecordModel paperOnlineRecordModel);



    List<JudgeTaskModelResult> queryAllByJudgeTask(JudgeTaskModelNorequired model);



    /**
     * 根据批卷班级名称模糊查询judgeTask
     * @param teachclassName 批卷班级名称
     * @param operator 操作人
     * @param pageNo 页码
     * @param pageSize 页数
     * @return
     * @author 刘梦娇
     * @since 2.0.0 2018年12月7日21:35:25
     */
    PageInfo<JudgeTaskModelResult> queryLikeClassName(String teachclassName, String operator, Integer pageNo, Integer pageSize);


    /**
     * 修改手动判分任务的批卷人
     * @param judgeTaskModel asasd
     * @return 修改后的结果
     * @author 刘梦娇
     * @since 2.0.0 2018-12-14 15:01:12
     */
    boolean modifyJudgeTask(JudgeTaskModel judgeTaskModel);
    /**
     * 添加判分任务到JudgeTask
     *
     * @param judgeTaskModel JudgeTaskModel
     * @return 添加判分任务
     * @author 杨海云
     * @since 2.0.0 2018-12-12 21:33:10
     */
    boolean insertJudgeTask (JudgeTaskModel judgeTaskModel);
    /**
     * 查询是否存在JudgeTask
     *
     * @param examinationId 考试id
     * @param templateDetilsId 题型名称id
     * @param teachClassId 批卷班级id
     * @return 查询是否存在 JudgeTask
     * @author 杨海云
     * @since 2.0.0 2018-12-12 21:33:10
     */
    List<JudgeTaskModel> queryExistJudgeTask(String examinationId, String templateDetilsId, String teachClassId);

    /**
     * 组合查询，根据考试id，题型id，批卷班级id，批卷教师id
     * @param operator 操作人
     * @param examinationId 考试id
     * @param templateDetailsId 题型id
     * @param teachclassId 批卷班级id
     * @param teacherId 批卷教师id
     * @param pageNo 分页页数
     * @param pageSize 分页大小
     * @return 符合条件的判分任务
     * @author 刘梦娇
     * @since 2018-12-18 19:45:21
     */
    PageInfo <JudgeTaskModelResult> queryCombine(String operator, String examinationId, String templateDetailsId, String teachclassId, String teacherId, Integer pageNo, Integer pageSize);

    boolean updateExamtionState(String examtionId);

    boolean importJson(File file) throws IOException;

    boolean againJudge(String examtionId);

    boolean againJudgeQuesIsDelete(String examtionId);

    boolean againJudgeQuesIsDelete();

    boolean againJudgeByBusiness();

    boolean totalScoreManyThread(List<TotalScoreModel> examineeModelList);
}

